<template>
9
</template>

<script>
import {doPost} from "@/utils/request";

export default {
  name: "PayResultView",

  mounted() {
    //从url的ext1,ext2中获取uid,token,向服务器发起请求,模拟登录,如果登录成功,跳转到用户中心.
    let uid=this.$route.query.ext1;
    let token=this.$route.query.ext2;
    this.autoLogin(uid,token);

  },
  methods:{
    autoLogin(uid,token){
      doPost('/pay/auto/login',{uid:uid,token:token}).then(resp=>{
        if (resp.code === 999){
          //保存登录的token到sessionStorage
          window.sessionStorage.setItem("ylb",JSON.stringify(resp.result));
          //跳转到用户中心
          this.$router.push({path:'/user/center'})
        }
      })
    }
  }
}
</script>

<style scoped>

</style>